﻿@using Ornament.NHibernates
@model Ornament.NHibernates.Configurations.SessionFactory
@{
    Layout = "~/Views/Shared/Master.cshtml";
    ViewBag.Title = "Index";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#nhibernateSetting").tabs();
        $("#sessionfactorySelector").change(function() {
            document.location = "@Url.Action("Index")" + "/" + $(this).val();
        });
    });
</script>
Configuration Files:
<select id="sessionfactorySelector">
    @foreach (var nhFileName in SessionManager.Configfiles)
    {
        var check = nhFileName.SessionFactoryName == this.Model.Name ? "checked=\"checked\"" : "";
        <option value="@nhFileName.SessionFactoryName" @check>@nhFileName.SessionFactoryName</option>
    }
</select>
<form method="POST">
<div>
    <input type="button" id="ReloadSessionFactory" value="重置" class="ui-state-default ui-corner-all" />
</div>
<div class="buttonContainer">
    <input id="Save" value="Save" type="submit" />
    <input id="CreateTable" value="Rebuild database" type="button" title="根据Mapping的信息,重建NHibernate管理下的相关数据表,数据将会被清除" />
    <input id="UpdateTable" value="Update database" type="button" title="更新数据结构。" />
    <input id="ShowLog" value="显示Log" type="button" title="显示日志" />
</div>
<div id="nhibernateSetting">
    <ul>
        <li><a href="#DriverType">DriverType</a></li>
        <li><a href="#runtime">Runtime</a></li>
        <li><a href="#mapping">Mapping</a></li>
    </ul>
    <div id="DriverType">
        @Html.Partial("DriverInfo", this.Model);
    </div>
    <div id="runtime">
        @Html.Partial("RuntimeInfo", this.Model.Runtime);
    </div>
    <div id="mapping">
        @Html.Partial("MappingList", this.Model.Mappings);
    </div>
</div>
</form>
